import requests
import json
import matplotlib.pyplot as plt
from matplotlib.pyplot import MultipleLocator
plt.rcParams['font.sans-serif'] = ['KaiTi']
plt.rcParams['font.serif'] = ['KaiTi']


def get_data2():
    url = 'https://view.inews.qq.com/g2/getOnsInfo?name=disease_other&callback=jQuery34109115895667113716_1582869774819&_=1582869774820'
    headers = {'user-agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Mobile Safari/537.36'}
    res = requests.get(url, headers=headers).text
    #res = requests.get(url).text
    a = res.split("jQuery34109115895667113716_1582869774819(")
    b=a[1]
    d=b[0:-1]
    c = json.loads(d)
    data2 = json.loads(c['data'])
    return data2


datas = get_data2()
with open("datas.txt","w") as file_obj:
    file_obj.write(str(datas))

with open("datas.txt","r") as file_obj:
    contents = file_obj.read()
data3 = contents.replace("'","\"")
data1 = json.loads(data3)

if data1 == datas:
    print("yes")
else:
    print("no")
